#ifndef __DISTANCE_H__
#define __DISTANCE_H__

#include "Tree.h"
#include <list>

enum DistanceType { NORMAL}; // with an option of expending

struct Match
{
	string a;
	string b;
	int distance;
};

struct Delete 
{
	string a;
	int distance;
};

typedef struct Match Match;
typedef struct Delete Delete;

class Distance
{
	DistanceType Dtype;
	list<Match> MatchList;//user defined special match cases
	list<Delete> DeleteList;//user defined special delete cases

public:
	Distance();
	void Load(string filename);
	void Clear();//clear all user defined special cases
	void SetDtype(DistanceType type);
	bool IsEmpty() const;//are there none user defined special cases?
	int DeleteNode(Tree* t1);
	int DeleteTree(Tree* t1);//delete the tree rooted in t1
	int MatchNodes(Tree* t1, Tree* t2);
	void UpdateTreeDeleteCosts(Tree* T);//update the DT value of all nodes in T
};


#endif

